<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Jobs\TestTask;
class IndexController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        //$this->middleware('auth');
    }

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {   
        //异步事件 
        $task = new TestTask('heal ceshi');
        $success = \Hhxsv5\LaravelS\Swoole\Task\Task::deliver($task); 
        print_r($success);

        //return view('home');
    }
    public function test(){
        $event = new \App\Events\TestEvent('测试异步事件监听及处理');
        $success = \Hhxsv5\LaravelS\Swoole\Task\Event::fire($event);
        var_dump($success);
    }

    public function haha(){
        
    }
}
